package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

public class FollowedShippingAddressDeleteRequest extends Request {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8374473723610301207L;


	private int id = 0;
	
    private String userId;

	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.id = requestInfo.getIntParameter(ApiUrlParamEnum.userShippingAddressId.getParamName(), -1);
		if ( id <1 ) {
			throw new RequestIllegalException("error id:"+id);
		}
		
		this.userId = requestInfo.getParameter(ApiUrlParamEnum.userId.getParamName(), "");
		if ( userId.equals("")) {
			throw new RequestIllegalException("error userId is null");
		}
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
}
